package com.test.utils;

import com.test.RocketStreamingJob;

import java.io.InputStream;
import java.util.Properties;

public class PropUtil {

    public static final String ROCKETMQ_NAME = "/rocketmq.properties";
    public static final String MONGODB_NAME = "/mongodb.properties";
    public static final String MARAIDB_NAME = "/mariadb.properties";
    public static final String CONFIG_NAME = "/config.properties";

    public static Properties getProperties(String name){
        Properties mqProp = null;
        try(InputStream in = RocketStreamingJob.class.getResourceAsStream(name)){
            mqProp = new Properties();
            mqProp.load(in);
        }catch (Exception e){
            e.printStackTrace();
        }
        return mqProp;
    }
}
